package com.siao.mvc.notice
{
	import com.siao.events.NoticeEvent;
	import com.siao.mvc.core.INotice;
	import com.siao.mvc.core.INotifier;
	
	import flash.events.EventDispatcher;
	
	[Event(name="complete", type="com.siao.events.NoticeEvent")]
	
	/**
	 * 消息
	 * @author SiaoLeon
	 */
	public class Notice extends EventDispatcher implements INotice
	{
		// -------------------------------------------------------------------------------------------------------- 静态常量
		
		// -------------------------------------------------------------------------------------------------------- 静态变量
		
		// -------------------------------------------------------------------------------------------------------- 静态方法
		
		// -------------------------------------------------------------------------------------------------------- 静态函数
		
		// -------------------------------------------------------------------------------------------------------- 属性
		
		private var _notifier:INotifier
		
		public function get notifier():INotifier
		{
			return this._notifier;
		}
		
		private var _method:Object;
		
		public function get method():Object
		{
			return this._method;
		}
		
		private var _queue:Object;
		
		public function get queue():Object
		{
			return this._queue;
		}
		
		private var _isBlock:Boolean;
		
		public function get isBlock():Boolean
		{
			return this._isBlock;
		}
		
		private var _params:*;
		
		public function get params():*
		{
			return this._params;
		}
		
		private var _result:Object;
		
		public function get result():Object
		{
			return this._result;
		}
		
		public function set result(value:Object):void
		{
			this._result = value;
		}
		
		// -------------------------------------------------------------------------------------------------------- 变量
		
		// -------------------------------------------------------------------------------------------------------- 构造
		
		/**
		 * 构造函数
		 */
		public function Notice(notifier:INotifier, method:Object, params:*=null, queue:Object=null, isBlock:Boolean=false)
		{
			this._notifier = notifier;
			this._method = method;
			this._queue = queue;
			this._isBlock = isBlock;
			this._params = params;
		}
		
		// -------------------------------------------------------------------------------------------------------- 方法
		
		public function complete():void
		{
			this.dispatchEvent(new NoticeEvent(NoticeEvent.COMPLETE));
		}
	
		// -------------------------------------------------------------------------------------------------------- 函数
	
	}
}
